 // 获取
 var last = document.querySelector('.top');
 last.addEventListener('click', function() {
     // 调用动画函数
     animate(window, 0, 0);
     // window.scroll(0, 0);
 });
 // 动画函数
 function animate(obj, target, callback) {
     clearInterval(obj.timer);
     obj.timer = setInterval(function() {
         var step = (target - window.pageYOffset) / 10;
         step = step > 0 ? Math.ceil(step) : Math.floor(step);
         if (window.pageYOffset == target) {
             clearInterval(obj.timer);
             callback && callback();
         }
         window.scroll(0, window.pageYOffset + step);
     }, 10);
 }